package thread;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;

public class BlockingQueueTest {
    public static void main(String[] args){
        BlockingQueue<String> bq = new ArrayBlockingQueue<>(2);
        try {
            bq.put("Java");
            bq.put("Java");
            bq.put("Java");//阻塞线程
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

}
